package com.zxf.basic.base

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.viewbinding.ViewBinding

/**
 * @author zjc
 * @date 2022/12/16
 */
abstract class BindingFragment<VB : ViewBinding>(private val inflate: (layoutInflater: LayoutInflater) -> VB) : BaseLazyFragment() {

    lateinit var binding: VB
    private set

    override fun layout(): Int = 0

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        binding = inflate.invoke(inflater)
        return binding.root
    }

}